<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<html:html>
<script type="text/javascript" src="pOperate/Bs_Tree.class.js"></script>
<script type="text/javascript" src="pOperate/Bs_TreeElement.class.js"></script>
<script type="text/javascript" src="pOperate/Bs_Array.class.js"></script>
<head>
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<LINK href="../styles/sciencee.css"  type=text/css rel=stylesheet>
		<LINK href="xtree.css"  type=text/css rel=stylesheet>
		<style type="text/css"></style>
		<title>CGProject</title>
		<html:base/>
</head>





<script language="javascript">
	var rootPath = '/CGProject';
	var total_array = new Array();
	var total_array1 = new Array();
	var total_array2 = new Array();
 	var a = new Array;
 	a[0] = new Array;
 	a[0]['caption']          = '<bean:write name="Tree" property="nodeName"/> ';
 	a[0]['url']              = rootPath+'/pOperate/goto.do?'+'<bean:write name="Tree" property="nodeLink"/>';
	a[0]['target']           = "panel";
	var i=-1;
</script>	
		<logic:iterate id="element" name="Tree" property="childs">
<script language="javascript">
		i++;
		
		if(i==0)
		{
			a[0]['children']      = new Array;
		}
		a[0]['children'][i]         = new Array;
		a[0]['children'][i]['caption']  ='<bean:write name="element" property="nodeName"/> ';
		a[0]['children'][i]['url']  = rootPath+'/pOperate/goto.do?'+'<bean:write name="element" property="nodeLink"/>';
		a[0]['children'][i]['target'] ="panel";
		var j=-1;
</script>
		<logic:notEmpty name="element" property="childs">
		<logic:notEqual name="element" property="nodeType" value="Task">
		<logic:empty name="element" property="childs">
			<script language="javascript"> a[0]['children'][i]['icon']="folderClosed.gif"</script>
		</logic:empty>				
		</logic:notEqual>

			<logic:iterate id="element1" name="element" property="childs">
<script language="javascript">
			j++;
			if(j==0)
			{
				a[0]['children'][i]['children']      = new Array;
			}
			a[0]['children'][i]['children'][j]      = new Array;
			a[0]['children'][i]['children'][j]['caption']  ='<bean:write name="element1" property="nodeName"/>';
			a[0]['children'][i]['children'][j]['url']  = rootPath+'/pOperate/goto.do?'+'<bean:write name="element1" property="nodeLink"/>';
			a[0]['children'][i]['children'][j]['target'] ="panel";
			var k=-1;
</script>	
			
			<logic:notEqual name="element1" property="nodeType" value="Task">
			<logic:empty name="element1" property="childs">
				<script language="javascript"> a[0]['children'][i]['children'][j]['icon']="folderClosed.gif"</script>
			</logic:empty>				
			</logic:notEqual>
			<logic:notEmpty name="element1"  property="nodeFlag">
				<script language="javascript"> a[0]['children'][i]['children'][j]['icon']="exclamation1.gif"</script>
			</logic:notEmpty>
			<logic:equal name="element1" property="nodeType" value="Element">
				
				<script language="javascript">total_array.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>'));</script>
			</logic:equal>
			<logic:equal name="element1" property="nodeType" value="Shot">
				
				<script language="javascript">total_array1.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>'));</script>
			</logic:equal>
			<logic:equal name="element1" property="nodeType" value="Shotgroup">
				
				<script language="javascript">total_array2.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>'));</script>
			</logic:equal>
			<logic:equal name="element1" property="nodeType" value="Elementgroup">
				
				<script language="javascript">total_array2.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>'));</script>
			</logic:equal>




				<logic:iterate id="element2" name="element1" property="childs">
<script language="javascript">
				k++;
				if(k==0)
				{
					a[0]['children'][i]['children'][j]['children']         = new Array;
				}
				a[0]['children'][i]['children'][j]['children'][k]      = new Array;
				a[0]['children'][i]['children'][j]['children'][k]['caption']  ='<bean:write name="element2" property="nodeName"/>';
				a[0]['children'][i]['children'][j]['children'][k]['caption']  ='<bean:write name="element2" property="nodeName"/>';
				a[0]['children'][i]['children'][j]['children'][k]['url']  = rootPath+'/pOperate/goto.do?'+'<bean:write name="element2" property="nodeLink"/>';
				a[0]['children'][i]['children'][j]['children'][k]['target'] ="panel";
				
				var l=-1;
</script>
				<logic:notEqual name="element2" property="nodeType" value="Task">
				<logic:empty name="element2" property="childs">
					<script language="javascript"> a[0]['children'][i]['children'][j]['children'][k]['icon']="folderClosed.gif"</script>
				</logic:empty>				
				</logic:notEqual>
				<logic:notEmpty name="element2"  property="nodeFlag">
					<script language="javascript"> a[0]['children'][i]['children'][j]['children'][k]['icon']="exclamation1.gif"</script>
				</logic:notEmpty>

				<logic:equal name="element2" property="nodeType" value="Element">
				
					<script language="javascript">total_array.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>'));</script>
				</logic:equal>
				<logic:equal name="element2" property="nodeType" value="Shot">
				
					<script language="javascript">total_array1.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>'));</script>
				</logic:equal>
				<logic:equal name="element2" property="nodeType" value="Shotgroup">
				
					<script language="javascript">total_array2.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>'));</script>
				</logic:equal>
				<logic:equal name="element2" property="nodeType" value="Elementgroup">
				
					<script language="javascript">total_array2.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>'));</script>
				</logic:equal>



	

					<logic:iterate id="element3" name="element2" property="childs">
<script language="javascript">
					
					l++;
					if(l==0)
					{
						a[0]['children'][i]['children'][j]['children'][k]['children']         = new Array;
					}
					a[0]['children'][i]['children'][j]['children'][k]['children'][l]      = new Array;
					a[0]['children'][i]['children'][j]['children'][k]['children'][l]['caption']  ='<bean:write name="element3" property="nodeName"/>';
					a[0]['children'][i]['children'][j]['children'][k]['children'][l]['url']  = '/CGProject/pOperate/goto.do?'+'<bean:write name="element3" property="nodeLink"/>';
					a[0]['children'][i]['children'][j]['children'][k]['children'][l]['target'] ="panel";
					var m=-1;

					</script>
					<logic:notEqual name="element3" property="nodeType" value="Task">
					<logic:empty name="element3" property="childs">
						<script language="javascript"> a[0]['children'][i]['children'][j]['children'][k]['children'][l]['icon']="folderClosed.gif"</script>
					</logic:empty>				
					</logic:notEqual>
					<logic:notEmpty name="element3"  property="nodeFlag">
						<script language="javascript"> a[0]['children'][i]['children'][j]['children'][k]['children'][l]['icon']="exclamation1.gif"</script>
					</logic:notEmpty>

					<logic:equal name="element3" property="nodeType" value="Element">
				
						<script language="javascript">total_array.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>'));</script>
					</logic:equal>
					<logic:equal name="element3" property="nodeType" value="Shot">
				
						<script language="javascript">total_array1.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>'));</script>
					</logic:equal>
					<logic:equal name="element3" property="nodeType" value="Shotgroup">
				
						<script language="javascript">total_array2.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>'));</script>
					</logic:equal>
					<logic:equal name="element3" property="nodeType" value="Elementgroup">
				
						<script language="javascript">total_array2.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>'));</script>
					</logic:equal>





						<logic:notEmpty name="element3" property="childs">
						<logic:iterate id="element4" name="element3" property="childs">
						<script language="javascript">
						m++;

						if(m==0)
						{
							a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children']         = new Array;
						}
						a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]      = new Array;
						a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['caption']  ='<bean:write name="element4" property="nodeName"/>';
						a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['url']  = '/CGProject/pOperate/goto.do?'+'<bean:write name="element4" property="nodeLink"/>';
						a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['target'] ="panel";
						var n=-1;
						</script>
						

						<logic:notEqual name="element4" property="nodeType" value="Task">
						<logic:empty name="element4" property="childs">
							<script language="javascript"> a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['icon']="folderClosed.gif"</script>
						</logic:empty>				
						</logic:notEqual>
						<logic:notEmpty name="element4"  property="nodeFlag">
							<script language="javascript"> a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['icon']="exclamation1.gif"</script>
						</logic:notEmpty>

						<logic:equal name="element4" property="nodeType" value="Element">
				
							<script language="javascript">total_array.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>','<bean:write name="element4" property="nodeName"/>'));</script>
						</logic:equal>
						<logic:equal name="element4" property="nodeType" value="Shot">
				
							<script language="javascript">total_array1.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>','<bean:write name="element4" property="nodeName"/>'));</script>
						</logic:equal>
						<logic:equal name="element4" property="nodeType" value="Shotgroup">
				
							<script language="javascript">total_array2.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>','<bean:write name="element4" property="nodeName"/>'));</script>
						</logic:equal>
						<logic:equal name="element4" property="nodeType" value="Elementgroup">
				
							<script language="javascript">total_array2.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>','<bean:write name="element4" property="nodeName"/>'));</script>
						</logic:equal>



	
							<logic:notEmpty name="element4" property="childs">
							<logic:iterate id="element5" name="element4" property="childs">
							<script language="javascript">
							n++;
	
							if(n==0)
							{
								a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children']         = new Array;
							}
							a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]      = new Array;
							a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['caption']  ='<bean:write name="element5" property="nodeName"/>';
							a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['url']  = '/CGProject/pOperate/goto.do?'+'<bean:write name="element5" property="nodeLink"/>';
							a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['target'] ="panel";
							var o=-1;
							</script>
							
	
							<logic:notEqual name="element5" property="nodeType" value="Task">
							<logic:empty name="element5" property="childs">
								<script language="javascript"> a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['icon']="folderClosed.gif"</script>
							</logic:empty>				
							</logic:notEqual>
							<logic:notEmpty name="element5"  property="nodeFlag">
								<script language="javascript"> a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['icon']="exclamation1.gif"</script>
							</logic:notEmpty>

							<logic:equal name="element5" property="nodeType" value="Element">
				
								<script language="javascript">total_array.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>','<bean:write name="element4" property="nodeName"/>','<bean:write name="element5" property="nodeName"/>'));</script>
							</logic:equal>
							<logic:equal name="element5" property="nodeType" value="Shot">
				
								<script language="javascript">total_array1.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>','<bean:write name="element4" property="nodeName"/>','<bean:write name="element5" property="nodeName"/>'));</script>
							</logic:equal>
							<logic:equal name="element5" property="nodeType" value="Shotgroup">
				
								<script language="javascript">total_array2.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>','<bean:write name="element4" property="nodeName"/>','<bean:write name="element5" property="nodeName"/>'));</script>
							</logic:equal>

							<logic:equal name="element5" property="nodeType" value="Elementgroup">
				
								<script language="javascript">total_array2.push(new Array('<bean:write name="Tree" property="nodeName"/> ','<bean:write name="element" property="nodeName"/> ','<bean:write name="element1" property="nodeName"/>','<bean:write name="element2" property="nodeName"/>','<bean:write name="element3" property="nodeName"/>','<bean:write name="element4" property="nodeName"/>','<bean:write name="element5" property="nodeName"/>'));</script>
							</logic:equal>



								<logic:notEmpty name="element5" property="childs">
								<logic:iterate id="element6" name="element5" property="childs">
								<script language="javascript">
								o++;
		
								if(o==0)
								{
									a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children']         = new Array;
								}
								a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children'][o]      = new Array;
								a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children'][o]['caption']  ='<bean:write name="element6" property="nodeName"/>';
								a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children'][o]['url']  = '/CGProject/pOperate/goto.do?'+'<bean:write name="element6" property="nodeLink"/>';
								a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children'][o]['target'] ="panel";
								var p=-1;
								</script>
								
		
								<logic:notEqual name="element6" property="nodeType" value="Task">
								<logic:empty name="element6" property="childs">
									<script language="javascript"> a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children'][o]['icon']="folderClosed.gif"</script>
								</logic:empty>				
								</logic:notEqual>



									<logic:notEmpty name="element6" property="childs">
									<logic:iterate id="element7" name="element6" property="childs">
									<script language="javascript">
									p++;
			
									if(p==0)
									{
										a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children'][o]['children']         = new Array;
									}
									a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children'][o]['children'][p]      = new Array;
									a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children'][o]['children'][p]['caption']  ='<bean:write name="element7" property="nodeName"/>';
									a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children'][o]['children'][p]['url']  = '/CGProject/pOperate/goto.do?'+'<bean:write name="element7" property="nodeLink"/>';
									a[0]['children'][i]['children'][j]['children'][k]['children'][l]['children'][m]['children'][n]['children'][o]['children'][p]['target'] ="panel";
									</script>
									
			
									</logic:iterate>
									</logic:notEmpty>	
								</logic:iterate>
								</logic:notEmpty>	
							</logic:iterate>
							</logic:notEmpty>	
						</logic:iterate>
						</logic:notEmpty>
					</logic:iterate>
				</logic:iterate>
			</logic:iterate>	
			</logic:notEmpty>
		</logic:iterate>	
		
		

		
<script language="javascript">
  var tree = new Bs_Tree();
function init() {
  //tree = new Bs_Tree();

  tree.imageDir = 'win98/';
  tree.initByArray(a);
  tree.drawInto('treeDiv1');
 
}
function test()
{
	var i=0;
	for(i=0;i<total_array.length;i++)
	{
		tree.openPath(total_array[i],'caption')	
	}

}
function test1()
{
	var i=0;
	for(i=0;i<total_array1.length;i++)
	{
		tree.openPath(total_array1[i],'caption')	
	}

}

function test2()
{
	var i=0;
	for(i=0;i<total_array2.length;i++)
	{
		tree.openPath(total_array2[i],'caption')	
	}

}

</script>	
<body onLoad="init();">
<table border="1" width="1258" id="table1" style="border-bottom:1px solid #C0C0C0; border-collapse: collapse; ">
		
		<tr>
		<td style=" border-bottom:1px solid #C0C0C0;"><input type="button" name="x" value="Elements" onclick="test();">
													  <input type="button" name="x" value="Shots" onclick="test1();">
													  <input type="button" name="x" value="Groups" onclick="test2();"><br></td>
		</tr>
	</table>
	
	
<div style="position: absolute; width: 300px; top: 40px; left: 0px; height: 94%; padding: 5px; overflow: auto;" id="treeDiv1">

</div>
<div style="position: absolute; left: 300px; top: 20px;height: 94%;">
	<iframe name="panel" marginwidth="0" marginheight="1" width="958"  border="0" frameborder="0" height="100%" src="./empty.htm" style="border-left:1px solid #C0C0C0">
			</iframe></div>
</body>
</html:html>	
